package jp.co.rc.entity;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.sql.SQLException;

@ControllerAdvice
public class TestException {

    @ExceptionHandler(value = SQLException.class)
    public void myException(Exception e) {
        System.out.println("这是一个异常");
        System.out.println(e.getMessage());
    }
}
